<template>
  <div style="text-align: center">
    <h5>您已成功登录此系统，请耐心等待页面跳转...<a href="/">手动跳转</a></h5>
  </div>
</template>

<script>
  import Vue from 'vue'
  import { getUserToken } from '@/api/login'
  import { ACCESS_TOKEN } from '@/store/mutation-types'

  export default {
    name: 'LoginSuccess',
    created () {
      let query = this.$route.query
      getUserToken(query).then(function(res) {
        let accessToken = res.data.accessToken
        Vue.ls.set(ACCESS_TOKEN,accessToken, 7 * 24 * 60 * 60 * 1000)
        window.opener.location.reload();
        window.close()
      })
    },
  }
</script>

<style scoped>

</style>